package com.shuiyun.jtt.message.jt808;

import com.shuiyun.jtt.anno.Message;
import com.shuiyun.jtt.enums.JT808;
import com.shuiyun.jtt.message.Header;
import com.shuiyun.jtt.message.JTMessage;
import com.shuiyun.jtt.utils.codec.DataType;
import com.shuiyun.jtt.utils.codec.FieldValue;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * @author shuiyun
 * @description 通用应答
 * @date 2022-04-20 00:17
 */
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Data
@Message({JT808.终端通用应答0x0001, JT808.平台通用应答0x8001})
public class T0001 extends JTMessage {

    /** 成功、确认 */
    public static final int SUCCESS = 0;
    /**失败 */
    public static final int FAILURE = 1;
    /**消息有误 */
    public static final int MESSAGE_ERROR = 2;
    /**不支持 */
    public static final int NOT_SUPPORT = 3;
    /**报警处理确认 */
    public static final int ALARM_ACK = 4;


    @FieldValue(type = DataType.WORD, desc = "应答流水号")
    private int serialNo;

    @FieldValue(type = DataType.WORD, desc = "应答ID")
    private int replyId;

    @FieldValue(type = DataType.BYTE, desc = "结果（响应码）")
    private int resultCode;

    public T0001(int serialNo, String mobileNo) {
        super(new Header(JT808.平台通用应答0x8001, serialNo, mobileNo));
    }
}
